<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>服务评价</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!--base css-->
    <link href="../css/mui/mui.css" rel="stylesheet">
    <link href="../css/app/default.css" rel="stylesheet">
    <!--自定义css-->
    <link href="../css/app/app.css" rel="stylesheet">
</head>

<body>
    <div class="mui-content">
        <div class="service-evaluate-wrap">
            <div class="service-evaluate-box">
                <div class="service-evaluate-head">
                    <span><img src="../img/common/evaluate-icon.png"></span>星级评价
                </div>
                <div class="service-evaluate-content" id="serviceStars">
                    <!-- <ul class="star-lists  justify-content-between">
                        <li>
                            <img src="../img/common/star.png">
                        </li>
                        <li>
                            <img src="../img/common/star.png">
                        </li>
                        <li>
                            <img src="../img/common/star.png">
                        </li>
                        <li>
                            <img src="../img/common/star2.png">
                        </li>
                        <li>
                            <img src="../img/common/star1.png">
                        </li>
                    </ul>
                    <div class="evaluate-label">
                        <span>太符号</span>
                        <span>服务号</span>
                        <span>服务号</span>
                    </div> -->
                </div>
            </div>
            <div class="service-evaluate-box">
                <div class="service-evaluate-head">
                    <span><img src="../img/common/evaluate-icon.png"></span>评价内容
                </div>
                <div class="service-evaluate-content">
                    <div id="content"></div>
                </div>
            </div>
            <!--  <button class="btn btn-blue btn-line margin-auto-btn">保存</button> -->
        </div>
    </div>
    <script src="../js/dsbridge.js"></script>
    <script src="../js/jquery.js"></script>
    <script src="../js/mui/mui.js"></script>
    <script src="../js/app/raty/jquery.raty.js"></script>
    <script src="../js/layer.js"></script>
    
    <script src="../js/app/app-base.js"></script>
    <script src="../js/app/app-url.js"></script>
    <script src="../js/app/app-ajax.js"></script>
    <script>
        var consultSessionId = dsBridge.call("getId", "");
        $(document).ready(function () {
            var requestData = {
                consultSessionId: consultSessionId
            };
            //加载评价详情详情
            getServerData(url_getConsultServiceAssessDetail, requestData);
        });

        function getServerDataSuccess(url, data) {
            setView(data.serviceAssess);
        }

        function setView(serviceAssess) {


            //消息发送给服务端成功
            if (isEmpty(serviceAssess)) {
                showToast('用户未进行评价');
            } else {
                var score = serviceAssess.score;
                var optsName = serviceAssess.optsName;
                var content = serviceAssess.content;
                var html_star = '<ul class="star-lists clearfix">';
                for (var i = 0; i < score; i++) {
                    html_star += '<li>';
                    html_star += '<img src="../img/common/star.png">';
                    html_star += '</li>';
                }
                if (score < 5) {
                    for (var i = 0; i < 5 - score; i++) {
                        html_star += '<li>';
                        html_star += '<img src="../img/common/star1.png">';
                        html_star += '</li>';
                    }
                }
                html_star += '</ul>';
                html_star += '<div class="evaluate-label">';
                if(!isEmpty(optsName)){
                var optArray = optsName.split(',');
                    for (var i = 0; i < optArray.length; i++) {
                        html_star += '<span>' + optArray[i] + '</span>';
                    }
                }
                html_star += '</div>';
                $('#serviceStars').html(html_star);
                $('#content').html(content);
            }
        }


    </script>
</body>

</html>